import { RouteRecordRaw } from 'vue-router'

import BasicData from '@/views/base/BasicData.vue'
import CateList from '@/views/base/CateList.vue'

// 客户模块相关组件
import IndustryList from '@/views/base/customer/IndustryList.vue'
import GradeList from '@/views/base/customer/GradeList.vue'
import SourceList from '@/views/base/customer/SourceList.vue'
import CustomerBasicList from '@/views/base/customer/BasicList.vue'

// 合同模块相关组件
import ContractCateList from '@/views/base/CateList.vue'
import ContractBasicData from '@/views/base/BasicData.vue'

const baseRoutes: Array<RouteRecordRaw> = [
  {
    path: '/base',
    redirect: '/user/basic',
    name: 'Base',
    meta: { title: '基础数据', icon: 'data-line' },
    children: [
      // 人事模块二级菜单
      {
        path: 'user',
        name: 'BaseUser',
        meta: { title: '人事模块', icon: 'user' },
        children: [
          {
            path: '/user/basic',
            name: 'BaseUserBasic',
            component: BasicData,
            meta: { title: '常规数据', icon: 'list' },
          },
          {
            path: 'cate',
            component: CateList,
            name: 'BaseCate',
            meta: { title: '数据分类', icon: 'folder' },
          },
        ],
      },
      // 客户模块子菜单
      {
        path: '/customer/industry',
        name: 'BaseCustomerIndustry',
        component: IndustryList,
        meta: { title: '行业类型', icon: 'industry' },
      },
      {
        path: '/customer/grade',
        name: 'BaseCustomerGrade',
        component: GradeList,
        meta: { title: '客户等级', icon: 'grade' },
      },
      {
        path: '/customer/source',
        name: 'BaseCustomerSource',
        component: SourceList,
        meta: { title: '客户渠道', icon: 'source' },
      },
      {
        path: '/customer/basic',
        name: 'BaseCustomerBasic',
        component: CustomerBasicList,
        meta: { title: '常规数据', icon: 'basic' },
      },
      // 合同模块子菜单
      {
        path: '/contract/cate',
        name: 'BaseContractCate',
        component: ContractCateList,
        meta: { title: '合同分类', icon: 'category' },
      },
      {
        path: '/contract/product',
        name: 'BaseContractProduct',
        component: ContractBasicData,
        meta: { title: '产品列表', icon: 'product' },
      },
      {
        path: '/contract/services',
        name: 'BaseContractServices',
        component: ContractBasicData,
        meta: { title: '服务内容', icon: 'service' },
      },
      {
        path: '/contract/supplier',
        name: 'BaseContractSupplier',
        component: ContractBasicData,
        meta: { title: '供应商列表', icon: 'supplier' },
      },
      {
        path: '/contract/purchasedcate',
        name: 'BaseContractPurchasedCate',
        component: ContractCateList,
        meta: { title: '采购品分类', icon: 'category' },
      },
      {
        path: '/contract/purchased',
        name: 'BaseContractPurchased',
        component: ContractBasicData,
        meta: { title: '采购品列表', icon: 'purchased' },
      },
    ],
  },
]

export default baseRoutes
